package cn.gok.oop.homework;

public class Worker {
    private String name;
    private String job;
    private int salary;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    public Worker() {
    }

    public Worker(String name, String job, int salary) {
        this.name = name;
        this.job = job;
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Worker{" +
                "name='" + name + '\'' +
                ", job='" + job + '\'' +
                ", salary=" + salary +
                '}';
    }
    //增加方法(工作了month个月，返回总的工资)
    public double doJob(int month){
        //System.out.println(this.name+"工作了"+month+"个月,获得了"+this.salary*month+"工资");
        return this.salary*month;
    }
}
